# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Justin Berthault <justin.berthault@zaclys.net>
pkgname=blocky
pkgver=0.22
pkgrel=1
pkgdesc="DNS proxy as ad-blocker for local network"
url="https://github.com/0xERR0R/blocky"
license="Apache-2.0"
arch="all"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/0xERR0R/blocky/archive/v$pkgver.tar.gz"
# fail with new go for some reason, even with tzdata/goroot
options="!check net"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make VERSION=$pkgver build
}

check() {
	make test
}

package() {
	install -Dm755 "bin/$pkgname" "$pkgdir/usr/bin/$pkgname"

	# blocky will not start if its log directory is missing
	mkdir -p "$pkgdir"/var/log/blocky

}

sha512sums="
928ba882cb567f80b9b00c1ab74ba2fba0324b9e5fb6439789d50d8fd438a26f84772d36f91ef9c3a2351c798a399c15aa1b69927a2da11795edd576b7bae6a4  blocky-0.22.tar.gz
"
